"""
字符串相关工具
"""
def str_reverse(s):
    """
    字符串反转
    :param s: 待反转字符串
    :return: 反转后的字符串
    """
    return s[::-1]

def substr(s, start, end):
    """
    字符串切片
    :param s: 即将被切片的字符串
    :param start: 切片开始下标
    :param end: 切片结束下标
    :return: 切片完成后的字符串
    """
    return s[start:end]

if __name__ == '__main__':
    print(str_reverse('abcdefg'))